package com.benyq.networkprogramme

import android.content.Context
import com.benyq.networkprogramme.base.adapter.BenyqBaseAdapter
import com.benyq.networkprogramme.base.adapter.BenyqRVHolder
import com.benyq.networkprogramme.base.bean.SimpleFriendBean
import java.text.SimpleDateFormat
import java.util.*

/**
 * @author benyq
 * @date 18-9-25 19:59
 * @E-mail： 1520063035@qq.com
 * @description
 */
class FriendAdapter(val context: Context): BenyqBaseAdapter<SimpleFriendBean>(context, R.layout.item_friend) {
    override fun convert(holder: BenyqRVHolder, position: Int, bean: SimpleFriendBean) {
        bean.run {
            holder.run {
                setText(R.id.tvMsg, msg)
                setText(R.id.tvName, name)
                setText(R.id.tvTime, SimpleDateFormat("HH:mm", Locale.CHINA).format(bean.time))
                setCircleImageUrl(R.id.ivIcon, "http://pic.nipic.com/2008-03-15/200831584830675_2.jpg")
            }
        }
    }
}